package com.shopping.dao;

import com.shopping.bean.Category;
import com.shopping.bean.OrderProduct;
import com.shopping.bean.Product;
import com.shopping.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductDao {
    int addProduct(@Param("product") Product product);
    int editProduct(@Param("product") Product product);
    int deleteProduct(@Param("id")int id);
    List<Product> getList(@Param("page") Page page, @Param("text")String text,@Param("category") String category);
    List<Product>  getChildren(@Param("id")int id);
    Product getProductByID(@Param("id")Integer id);
    int getCount(@Param("text")String text,@Param("category") String category);

    List<Product> getProductsByCategoryName(@Param("categoryname") String categoryname);
    void updateStockAndSales(@Param("orderProducts") List<OrderProduct> orderProducts);
    List<Product> getAllProductSalesAndStocks();

}
